home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Speccy ClassiX 1998
/
Speccy ClassiX 98.iso
/
amiga_system
/
the_aminet
/
dev
/
gcc
/
ixemulsrc.lha
/
ixemul-41.4
/
libsrc
/
__panic.c
next >
Wrap
C/C++ Source or Header
|
1995-05-21
|
3KB
|
91 lines
/*
* This once was req.c by Markus Wandel. It doesn't look too much like the
* original version though... Well, it was PD, I used it, so here is his
* original disclaimer:
*
* req.c - by Markus Wandel - 1990
* Placed in the public domain 7 Oct 1990
* Please have the courtesy to give credit if you use this code
* in any program.
*
*/
#include <exec/types.h>
#include <intuition/intuition.h>
#define BASE_EXT_DECL
#define BASE_EXT_DECL0
#define BASE_PAR_DECL struct IntuitionBase *IntuitionBase,
#define BASE_PAR_DECL0 struct IntuitionBase *IntuitionBase
#include <inline/intuition.h>
#define BASE_PAR_DECL
#define BASE_PAR_DECL0 void
#define BASE_NAME *(void **)4
static __inline void
CopyMem (BASE_PAR_DECL APTR source,APTR dest,unsigned long size)
{
register struct ExecBase *a6 __asm("a6") = BASE_NAME;
register APTR a0 __asm("a0") = source;
register APTR a1 __asm("a1") = dest;
register unsigned long d0 __asm("d0") = size;
__asm __volatile ("jsr a6@(-0x270)"
: /* no output */
: "r" (a6), "r" (a0), "r" (a1), "r" (d0)
: "a0","a1","d0","d1", "memory");
}
static __inline void
CloseLibrary (BASE_PAR_DECL struct Library *library)
{
register struct ExecBase *a6 __asm("a6") = BASE_NAME;
register struct Library *a1 __asm("a1") = library;
__asm __volatile ("jsr a6@(-0x19e)"
: /* no output */
: "r" (a6), "r" (a1)
: "a0","a1","d0","d1", "memory");
}
static __inline struct Library *
OpenLibrary (BASE_PAR_DECL UBYTE *libName,unsigned long version)
{
register struct Library * _res __asm("d0");
register struct ExecBase *a6 __asm("a6") = BASE_NAME;
register UBYTE *a1 __asm("a1") = libName;
register unsigned long d0 __asm("d0") = version;
__asm __volatile ("jsr a6@(-0x228)"
: "=r" (_res)
: "r" (a6), "r" (a1), "r" (d0)
: "a0","a1","d0","d1", "memory");
return _res;
}
int
__request_msg (const char *msg, const char *button)
{
struct IntuiText line, righttext;
struct IntuitionBase *IntuitionBase;
int result;
/* we (re)open intuition, because that way we don't depend on arp.library
* being available for us to open intuibase */
if (IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0))
{
line.FrontPen = AUTOFRONTPEN;
line.BackPen = AUTOBACKPEN;
line.DrawMode = AUTODRAWMODE;
line.ITextFont = AUTOITEXTFONT;
line.NextText = 0;
CopyMem(&line, &righttext, sizeof(line));
righttext.LeftEdge = AUTOLEFTEDGE;
righttext.TopEdge = AUTOTOPEDGE;
line.LeftEdge = 15;
line.TopEdge = 5;
line.IText = (UBYTE *) msg;
righttext.IText = (UBYTE *) button;
result = AutoRequest(IntuitionBase,0L,&line,0L,&righttext,0L,0L,320L,72L);
CloseLibrary(IntuitionBase);
return result;
}
return -1;
}